/**
 *  
 * @package Nokia Places Plugin
 * @title Iframe resize function inside WYSIWYG editor
 * @author Nikolai Tihhomirov
 *
 */

function reSize()
{
	//wait for json to load
	setTimeout( function(){
		//Get unique frameid from meta tag
		var iframeid = document.getElementById( 'iframeid' ).getAttribute( 'content'  );
		//now get parent iframe
		var places_iframe = parent.document.getElementById( 'places_api_view'+iframeid );
		//Calculate right size
		var x = places_iframe.contentWindow.document.body.scrollWidth;
		var y = places_iframe.contentWindow.document.body.scrollHeight;
		//resize
		if(navigator.userAgent.match(/opera/gi)){ x=x*2; y=y+20; }
		if(navigator.userAgent.match(/MSIE/gi)){ x=x+10; y=y+20; }
		places_iframe.height = y;
		places_iframe.width = x;
	}, 1000 );
}